package ua.kpi_java_training.evgeniygusar.module2;


import java.util.ArrayList;

public class AllPredators {
    int PREDATOR_BIRTH_CYCLE = 4;
    static private int total_number_of_eated_victims = 0;
    AllVictims victimsObject = new AllVictims();
    static private ArrayList<Predator> predators = new ArrayList<Predator>();

    public int getTotalNumberOfEatedVictims() {
        return total_number_of_eated_victims;
   }

    public void incrementTotalNumberOfEatedVictims() {
       total_number_of_eated_victims++;
   }

    public int getPredatorBirthCycle() {
        return PREDATOR_BIRTH_CYCLE;
    }

    public void addPredator() {
        predators.add(new Predator());
    }

    public Predator getPredator(int position) {
        return predators.get(position);
    }

    public void predatorsMoving() {
        for(Predator p: predators) {
            if(victimsObject.numbersOfVictims() != 0) {
                System.out.println("Predator " + (predators.indexOf(p) + 1) + ": ");
                p.Moving();
            }
        }
    }

    public int numbersOfPredators() {
        return predators.size();
    }
}
